package com.fzhucc.modules.subject.service.mapstruct;

import com.fzhucc.modules.subject.domain.dto.SubjectHighfieldsType1CreateDto;
import com.fzhucc.modules.subject.domain.dto.SubjectHighfieldsType1QueryDto;
import com.fzhucc.modules.subject.domain.entity.SubjectHighfieldsType1;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

/**
* @website https://fzhucc.com
* @author yyg
* @since 2022-09-26 00:00:00
**/
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public class SubjectHighfieldsType1Mapper {
    public SubjectHighfieldsType1CreateDto toCreateDto(SubjectHighfieldsType1 entity){
        if(entity == null){
            return null;
        }
        SubjectHighfieldsType1CreateDto dto = new SubjectHighfieldsType1CreateDto();
        dto.setId(entity.getId());
        dto.setHighfields1(entity.getHighfields1());
        dto.setName(entity.getName());
        return dto;
    }
    public SubjectHighfieldsType1QueryDto toQueryDto(SubjectHighfieldsType1 entity){
        if(entity == null){
            return null;
        }
        SubjectHighfieldsType1QueryDto dto = new SubjectHighfieldsType1QueryDto();
        dto.setId(entity.getId());
        dto.setHighfields1(entity.getHighfields1());
        dto.setName(entity.getName());
        return dto;
    }

    public SubjectHighfieldsType1 toEntity(SubjectHighfieldsType1CreateDto dto){
        if(dto == null){
            return null;
        }
        SubjectHighfieldsType1 entity = new SubjectHighfieldsType1();
        entity.setId(dto.getId());
        entity.setHighfields1(dto.getHighfields1());
        entity.setName(dto.getName());
        return entity;
    }

    public SubjectHighfieldsType1 toEntity(SubjectHighfieldsType1QueryDto dto){
        if(dto == null){
            return null;
        }
        SubjectHighfieldsType1 entity = new SubjectHighfieldsType1();
        entity.setId(dto.getId());
        entity.setHighfields1(dto.getHighfields1());
        entity.setName(dto.getName());
        return entity;
    }
}